package cn.wolfcode.p2p.business.service;

import cn.wolfcode.p2p.base.domain.Account;
import cn.wolfcode.p2p.business.domain.AccountFlow;
import cn.wolfcode.p2p.business.domain.BidRequest;
import cn.wolfcode.p2p.business.domain.PaymentSchedule;
import cn.wolfcode.p2p.business.domain.RechargeOffline;

import java.math.BigDecimal;

/**
 * 个人账户流水
 */
public interface IAccountFlowService {
    /**
     * 保存流水记录
     * @param amount
     * @param note
     * @param actionType
     * @param account
     * @return
     */
    AccountFlow save(BigDecimal amount, Account account, Integer actionType, String note);
    /**
     * 保存充值流水记录
     * @param ro 充值RechargeOffline对象
     * @param account 个人账户对象Account
     */
    void createRechargeFlow(RechargeOffline ro, Account account);

    /**
     * 创建游标流水
     */
    void createBidFlow(Account account, BigDecimal amount);

    /**
     * 满标一审失败流水
     * @param br
     */
    void createBidFailureFlow(Account bidAccount, BigDecimal amount, BidRequest br);

    /**
     * 创建借款成功流水
     */
    void createBidRequestFlow(Account account, BidRequest br);

    /**
     * 借款平台的流水
     */
    void createPayBorrowManagementChargeFlow(BigDecimal charge, Account account, BidRequest bidRequest);

    /**
     * 投资人冻结账户金额减少
     * @param availableAmount
     * @param bidAccount
     * @param br
     */
    void createFreezedAmountFlow(BigDecimal availableAmount, Account bidAccount, BidRequest br);

    /**
     * 创建还款流水
     * @param account
     * @param totalAmount
     * @param ps
     */
    void createReturnMoneyFlow(Account account, BigDecimal totalAmount, PaymentSchedule ps);

    /**
     * 创建收款流水
     * @param bidAccount
     * @param totalAmount
     * @param ps
     */
    void createReceiveFlow(Account bidAccount, BigDecimal totalAmount, PaymentSchedule ps);

    /**
     * 支付信息管理费流水
     * @param bidAccount
     * @param managerCharge
     */
    void createManagerChargeFlow(Account bidAccount, BigDecimal managerCharge);

    /**
     * 线上充值流水
     */
    void createRechargeOnlineSuccessFlow(Account account, BigDecimal amount);
}
